export default {
    namespaced: true,
    state: () => ({
        pageNum: '0',
        caseNum: '0',
        showNav: true,
        showMessage: '',
        bread: []
    }),
    mutations: {
        SET_BREAD: (state, bread) => {
            state.bread = bread;
        },
        SET_THEME_HOMEPAGE: (state, theme) => {
            if(state.pageNum%2==0){
                state.theme = 'white';
                state.pageNum++;
            } else{
                state.theme = 'dark';
                state.pageNum++;
            }
        },
        RESET_INDEX_NUM: (state, theme) => {
            state.pageNum = 0;
        },
        SET_THEME_CASE: (state, theme) => {
            if(state.caseNum == 0){
                state.theme = 'dark';
            }
        },
        SET_NAV_SHOW: (state, value) => {
            state.showNav = value;
        },
        SET_MESSAGE_SHOW: (state, value) => {
            state.showMessage = value;
            localStorage.setItem('MESSAGE_HIDE', value ? '' : 'hide');
        },
    }
};